package com.edfu.core.coursemgt.persistence.entity;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.edfu.core.institutemgt.persistence.entity.AcadSemBranchRelnEntity;

/**
 * 
 * @author sahsharm
 *
 */
@Entity
@Table(name="semester_branch_course")
public class AcadSemCourseBranchRelnEntity implements ICourseMgtEntity {
	private long id;
	private CourseEntity course;
	private AcadSemBranchRelnEntity semInBranch;
	private Set<AcadSemCourseBranchUserRelnEntity> teachers;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name = "course_id", nullable = false)
	public CourseEntity getCourse() {
		return course;
	}
	public void setCourse(CourseEntity course) {
		this.course = course;
	}
	
	@ManyToOne
	@JoinColumn(name = "semester_branch_id", nullable = false)
	public AcadSemBranchRelnEntity getSemInBranch() {
		return semInBranch;
	}
	public void setSemInBranch(AcadSemBranchRelnEntity semInBranch) {
		this.semInBranch = semInBranch;
	}
	
	@OneToMany(mappedBy = "courseInGivenSemInBranch", fetch= FetchType.EAGER)
	public Set<AcadSemCourseBranchUserRelnEntity> getTeachers() {
		return teachers;
	}
	public void setTeachers(Set<AcadSemCourseBranchUserRelnEntity> teachers) {
		this.teachers = teachers;
	}
	
	
	
}
